package com.test.test01.serviceImpl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.test.test01.bean.Banner;
import com.test.test01.mapper.BannerMapper;
import com.test.test01.service.BannerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> implements BannerService {

    @Resource
    private BannerMapper bannerMapper;

    @Override
    public int saveBanner(Banner banner) {
        int insert = bannerMapper.insert(banner);
        return insert;
    }

    @Override
    public List<Banner> listBanner() {
        return bannerMapper.selectList(Wrappers.lambdaQuery(Banner.class));
    }
}
